package com.theo.service.impl;

import com.theo.entity.HospitalInfo;
import com.theo.mapper.HospitalInfoMapper;
import com.theo.service.HospitalInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Service
public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, HospitalInfo> implements HospitalInfoService {

    @Autowired
    private HospitalInfoMapper hospitalInfoMapper;

    @Override
    public int saveHospitalInfo(HospitalInfo hospitalInfo) {
        return hospitalInfoMapper.insert(hospitalInfo);
    }

    @Override
    public int deleteHospitalInfo(Integer id) {
        return hospitalInfoMapper.deleteById(id);
    }

    @Override
    public int updateHospitalInfo(HospitalInfo hospitalInfo) {
        return hospitalInfoMapper.updateById(hospitalInfo);
    }

    @Override
    public List<HospitalInfo> queryAllHospitalInfo() {
        return hospitalInfoMapper.queryAllHospitalInfo();
    }

    @Override
    public List<HospitalInfo> queryHospitalInfoByCityId(Map<String, Object> map) {
        return hospitalInfoMapper.queryHospitalInfoByCityId(map);
    }
}
